﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace HomeData.BaseLibrary
{
    [DataContract(Name = Constants.Global.Namespace)]
    public class BusinessObjectValidationError<T> : Exception
        where T : BusinessObjectBase
    {
        public string Field
        {
            get;
            set;
        }

        public string ErrorMessage
        {
            get;
            set;
        }

        public override string Message
        {
            get
            {
                return ErrorMessage ?? base.Message;
            }
        }

        public T Item
        {
            get;
            set;
        }
    }
}
